﻿using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Text;
using System.Windows.Data;
using WPFDataModel.DataModel;


namespace WPFDataModel.ViewModel
{
    public class GroupViewModel : NotifyPropertyChangedBase
    {
        #region Static Variables
        #endregion

        #region Member Variables
        private ObjectSet<Group> m_groupObjectSet;
        private ListCollectionView m_groups;
        #endregion

        #region Propertys
        /// <summary>
        /// Objectset der Gruppen
        /// </summary>
        public ObjectSet<Group> GroupObjectSet
        {
            get { return m_groupObjectSet; }
            set { m_groupObjectSet = value; }
        }

        /// <summary>
        /// ListViewCollection mit den Gruppen
        /// </summary>
        public ListCollectionView Groups
        {
            get { return m_groups; }
            set
            {
                m_groups = value;
                OnPropertyChanged(System.Reflection.MethodBase.GetCurrentMethod().Name);
            }
        }

        #endregion

        #region Contructors
        public GroupViewModel()
        {
            GroupObjectSet = DataConnection.GetDataConnection().DataModel.GroupSet;
            Groups = new ListCollectionView(GroupObjectSet.ToList());
        }
        #endregion

        #region Public Functions
        #endregion

        #region Private Functions
        #endregion
    }
}
